home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Netware Super Library
/
Netware Super Library.iso
/
mis_cnvt
/
sdf2db
/
sdf2dbf.doc
< prev
Wrap
Text File
|
1987-11-15
|
4KB
|
98 lines
SDF2DBF - Convert System Data Format to Data-Base File
INTRODUCTION
dBASE allows you to append data to an existing data-base from an
ASCII file with a corresponding format. This format, SDF or System
Data Format, has data in columns the same width as the dBASE field
widths, one record per line.
The major shortcoming of this is that the data-base must exist
before you try to append data to it. SDF2DBF allows you to
annotate an SDF file with field names and convert it directly to a
dBASE data-base (DBF file). It has been tested with dBASE III Plus
and may work with dBASE III. dBASE II format is not supported.
USAGE
The syntax for SDF2DBF is as follows:
SDF2DBF [file [P][D][Q]]
To run SDF2DBF interactively, type SDF2DBF at the PC/MS-DOS prompt;
you will be prompted for the name of the file to convert and told
how may records and fields were processed. Purge, Date and Quiet
options are not available with interactive use.
Two runstring options, Q and P, are provided to aid in the use of
SDF2DBF within batch files. The Q(uiet) option suppresses all
screen output. The P(urge) option allows SDF2DBF to overwrite an
existing data-base if it exists. In addition, SDF2DBF will return
any non-normal status in the DOS return code accessed by
Errorlevel. Possible values are:
1 - SDF2DBF could not find the specified SDF file
2 - The DBF file already exists and Purge was not specified.
The last option, D(ate), causes SDF2DBF to analyze numeric fields
of length 8 to see if they are valid dates. Note that this means
December 1, 1 A.D. would be in the SDF file as 00011201; the
leading zeros are necessary to make the field 8 characters long.
EXAMPLE
Examples seem to be the best documentation. With that in mind,
consider the annotated SDF file:
LNAME FNAME SHOESIZE PHONE BDAY TITLE
Smith Bob 9 (111)555-123419521022Big Chief
Jones Davey 10 (222)555-234519411207Sailor
Brown Buster 7 (333)555-345620100101Salesman
When SDF2DBF processes this file with the D option, it creates a
data-base of three records of five fields each. The structure of
the data-base is as follows:
Name Type Width
LNAME Character 15
FNAME Character 10
SHOESIZE Numeric 9
PHONE Character 13
BDAY Date 8
TITLE Character 9
The name and width of each field is determined from the first
record of the annotated SDF file (this is the record which would
NOT be in a standard dBASE SDF file). The width of all but the
last field is taken from the spacing of the names. The width of
the last field is set to the maximum length of any datum for that
field (e.g. LENGTH('Big Chief')) or the length of the name,
whichever is longer. Note that it is not possible to have a field
whose width is less than the length of its name and that D(ate)
fields must have names less than 8 characters long.
The type for each field is determined from the type of data found
in the corresponding column of the SDF file. By default, SDF2DBF
only creates Numeric and Character type fields. A Numeric consists
only of digits (0..9), negative signs, and decimals. Any thing
else is considered a Character. No checking is done for multiple
decimals or a non-leading negative sign. To allow 19521022 to be
interpreted as October 22, 1952 instead of 19,521,022.00, specify
the D(ate) option on the runstring.
COPYRIGHT NOTICE
SDF2DBF is a shareware program. You may copy and distribute it
freely. If you find you like it and use it, please send what you
think it is worth ($15 suggested) to:
Christopher Nelson
160 Ontario Street
Buffalo, NY 14207